﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum E_Style_OnOff
{
    On,
    Off
}

public abstract class CustomGUIControl : MonoBehaviour
{
    //提取控件的共同表现
    //位置信息
    public CustomGUIPos guiPos;
    //显示内容信息
    public GUIContent content;
    //自定义样式
    public GUIStyle style;
    //样式开关
    public E_Style_OnOff styleOnOrOff = E_Style_OnOff.Off;

    protected abstract void StyleOffDraw();
    protected abstract void StyleOnDraw();

    public void DrawGUI()
    {
        if (styleOnOrOff == E_Style_OnOff.Off)
        {
            StyleOffDraw();
        }
        else
        {
            StyleOnDraw();
        }
    }
    public void SetText(string text)
    {
        content.text = text;
    }

    public string GetText()
    {
        return content.text;
    }
}
